﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraLayout;
    using DevExpress.XtraLayout.Utils;
    using APP.HELPER;
    using HRM.CORE;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;
    using Common;
    using Security.ERP;

    public class xucInsuranceAdd : Common.xucBaseAddH
    {
        private CalcEdit calHealthInsurance;
        private CalcEdit calMaximumInsurance;
        private CalcEdit calMinimumSalary;
        private CalcEdit calQuantityHealthInsurance;
        private CalcEdit calQuantitySocialInsurance;
        private CalcEdit calQuantityUnemploymentInsurance;
        private CalcEdit calSendHealthInsurance;
        private CalcEdit calSendSocialInsurance;
        private CalcEdit calSendUnemploymentInsurance;
        private CalcEdit calSocialInsurance;
        private CalcEdit calUnemploymentInsurance;
        private CalcEdit calWageHealthInsurance;
        private CalcEdit calWageSocialInsurance;
        private CalcEdit calWageUnemploymentInsurance;
        private IContainer components = null;
        private TimeEdit dtMonth;
        private TimeEdit dtYear;
        private EmptySpaceItem emptySpaceItem1;
        private EmptySpaceItem emptySpaceItem2;
        private GroupBox groupBox1;
        private GroupControl groupControl1;
        private LayoutControl layoutControl1;
        private LayoutControl layoutControl2;
        private LayoutControlGroup layoutControlGroup1;
        private LayoutControlGroup layoutControlGroup2;
        private LayoutControlItem layoutControlItem1;
        private LayoutControlItem layoutControlItem10;
        private LayoutControlItem layoutControlItem11;
        private LayoutControlItem layoutControlItem12;
        private LayoutControlItem layoutControlItem13;
        private LayoutControlItem layoutControlItem14;
        private LayoutControlItem layoutControlItem15;
        private LayoutControlItem layoutControlItem16;
        private LayoutControlItem layoutControlItem17;
        private LayoutControlItem layoutControlItem18;
        private LayoutControlItem layoutControlItem19;
        private LayoutControlItem layoutControlItem2;
        private LayoutControlItem layoutControlItem20;
        private LayoutControlItem layoutControlItem21;
        private LayoutControlItem layoutControlItem3;
        private LayoutControlItem layoutControlItem4;
        private LayoutControlItem layoutControlItem5;
        private LayoutControlItem layoutControlItem6;
        private LayoutControlItem layoutControlItem7;
        private LayoutControlItem layoutControlItem8;
        private LayoutControlItem layoutControlItem9;
        private Guid m_InsuranceTableListID = Guid.Empty;
        private RadioGroup rdIsBegin;
        private SpinEdit txtCourse;
        private MemoEdit txtDescription;
        private TextEdit txtName;

        public event SuccessEventHander Success;

        public xucInsuranceAdd()
        {
            this.InitializeComponent();
            this.InitComponent();
        }

        protected override void Add()
        {
            base.Add();
            HRM_INSURANCE_TABLELIST hrm_insurance_tablelist = new HRM_INSURANCE_TABLELIST();
            this.txtName.Focus();
        }

        public void Clear()
        {
            this.txtName.Text = "";
            this.txtDescription.Text = "";
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void dtMonth_EditValueChanging(object sender, ChangingEventArgs e)
        {
            this.txtName.Text = "Đợt " + this.txtCourse.Text + " (Th\x00e1ng " + DateTime.Parse(e.NewValue.ToString()).Month.ToString() + "/" + DateTime.Parse(this.dtYear.EditValue.ToString()).Year.ToString() + ")";
        }

        private void dtYear_EditValueChanging(object sender, ChangingEventArgs e)
        {
            this.txtName.Text = "Đợt " + this.txtCourse.Text + " (Th\x00e1ng " + DateTime.Parse(this.dtMonth.EditValue.ToString()).Month.ToString() + "/" + DateTime.Parse(e.NewValue.ToString()).Year.ToString() + ")";
        }

        protected override void Init()
        {
        }

        private void InitComponent()
        {
            this.dtMonth.EditValue = DateTime.Now;
            this.dtYear.EditValue = DateTime.Now;
            this.calQuantitySocialInsurance.EditValue = 0;
            this.calQuantityHealthInsurance.EditValue = 0;
            this.calQuantityUnemploymentInsurance.EditValue = 0;
            this.calWageSocialInsurance.EditValue = 0;
            this.calWageHealthInsurance.EditValue = 0;
            this.calWageUnemploymentInsurance.EditValue = 0;
            this.calSendSocialInsurance.EditValue = 0;
            this.calSendHealthInsurance.EditValue = 0;
            this.calSendUnemploymentInsurance.EditValue = 0;
            DIC_SALARY_FORMULA dic_salary_formula = new DIC_SALARY_FORMULA();
            dic_salary_formula.Get();
            this.calSocialInsurance.EditValue = 20;
            this.calHealthInsurance.EditValue = 3;
            this.calUnemploymentInsurance.EditValue = 2;
            this.calMaximumInsurance.EditValue = dic_salary_formula.MaximumInsurance;
            DIC_MINIMUMSALARY dic_minimumsalary = new DIC_MINIMUMSALARY();
            dic_minimumsalary.Get();
            this.calMinimumSalary.EditValue = dic_minimumsalary.Money;
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xucInsuranceAdd));
            this.groupControl1 = new GroupControl();
            this.layoutControl1 = new LayoutControl();
            this.txtDescription = new MemoEdit();
            this.rdIsBegin = new RadioGroup();
            this.groupBox1 = new GroupBox();
            this.layoutControl2 = new LayoutControl();
            this.calSendUnemploymentInsurance = new CalcEdit();
            this.calWageUnemploymentInsurance = new CalcEdit();
            this.calSendHealthInsurance = new CalcEdit();
            this.calWageHealthInsurance = new CalcEdit();
            this.calSendSocialInsurance = new CalcEdit();
            this.calWageSocialInsurance = new CalcEdit();
            this.calQuantityUnemploymentInsurance = new CalcEdit();
            this.calQuantityHealthInsurance = new CalcEdit();
            this.calQuantitySocialInsurance = new CalcEdit();
            this.layoutControlGroup2 = new LayoutControlGroup();
            this.layoutControlItem11 = new LayoutControlItem();
            this.layoutControlItem12 = new LayoutControlItem();
            this.layoutControlItem13 = new LayoutControlItem();
            this.layoutControlItem14 = new LayoutControlItem();
            this.layoutControlItem15 = new LayoutControlItem();
            this.layoutControlItem16 = new LayoutControlItem();
            this.layoutControlItem17 = new LayoutControlItem();
            this.layoutControlItem18 = new LayoutControlItem();
            this.layoutControlItem19 = new LayoutControlItem();
            this.calUnemploymentInsurance = new CalcEdit();
            this.calHealthInsurance = new CalcEdit();
            this.calSocialInsurance = new CalcEdit();
            this.calMaximumInsurance = new CalcEdit();
            this.calMinimumSalary = new CalcEdit();
            this.txtCourse = new SpinEdit();
            this.dtYear = new TimeEdit();
            this.dtMonth = new TimeEdit();
            this.txtName = new TextEdit();
            this.layoutControlGroup1 = new LayoutControlGroup();
            this.layoutControlItem1 = new LayoutControlItem();
            this.layoutControlItem2 = new LayoutControlItem();
            this.layoutControlItem3 = new LayoutControlItem();
            this.layoutControlItem4 = new LayoutControlItem();
            this.layoutControlItem5 = new LayoutControlItem();
            this.layoutControlItem6 = new LayoutControlItem();
            this.layoutControlItem7 = new LayoutControlItem();
            this.layoutControlItem8 = new LayoutControlItem();
            this.layoutControlItem9 = new LayoutControlItem();
            this.layoutControlItem10 = new LayoutControlItem();
            this.emptySpaceItem1 = new EmptySpaceItem();
            this.emptySpaceItem2 = new EmptySpaceItem();
            this.layoutControlItem20 = new LayoutControlItem();
            this.layoutControlItem21 = new LayoutControlItem();
            ((ISupportInitialize) base.Err).BeginInit();
            base.imageCollection2.BeginInit();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.layoutControl1.BeginInit();
            this.layoutControl1.SuspendLayout();
            this.txtDescription.Properties.BeginInit();
            this.rdIsBegin.Properties.BeginInit();
            this.groupBox1.SuspendLayout();
            this.layoutControl2.BeginInit();
            this.layoutControl2.SuspendLayout();
            this.calSendUnemploymentInsurance.Properties.BeginInit();
            this.calWageUnemploymentInsurance.Properties.BeginInit();
            this.calSendHealthInsurance.Properties.BeginInit();
            this.calWageHealthInsurance.Properties.BeginInit();
            this.calSendSocialInsurance.Properties.BeginInit();
            this.calWageSocialInsurance.Properties.BeginInit();
            this.calQuantityUnemploymentInsurance.Properties.BeginInit();
            this.calQuantityHealthInsurance.Properties.BeginInit();
            this.calQuantitySocialInsurance.Properties.BeginInit();
            this.layoutControlGroup2.BeginInit();
            this.layoutControlItem11.BeginInit();
            this.layoutControlItem12.BeginInit();
            this.layoutControlItem13.BeginInit();
            this.layoutControlItem14.BeginInit();
            this.layoutControlItem15.BeginInit();
            this.layoutControlItem16.BeginInit();
            this.layoutControlItem17.BeginInit();
            this.layoutControlItem18.BeginInit();
            this.layoutControlItem19.BeginInit();
            this.calUnemploymentInsurance.Properties.BeginInit();
            this.calHealthInsurance.Properties.BeginInit();
            this.calSocialInsurance.Properties.BeginInit();
            this.calMaximumInsurance.Properties.BeginInit();
            this.calMinimumSalary.Properties.BeginInit();
            this.txtCourse.Properties.BeginInit();
            this.dtYear.Properties.BeginInit();
            this.dtMonth.Properties.BeginInit();
            this.txtName.Properties.BeginInit();
            this.layoutControlGroup1.BeginInit();
            this.layoutControlItem1.BeginInit();
            this.layoutControlItem2.BeginInit();
            this.layoutControlItem3.BeginInit();
            this.layoutControlItem4.BeginInit();
            this.layoutControlItem5.BeginInit();
            this.layoutControlItem6.BeginInit();
            this.layoutControlItem7.BeginInit();
            this.layoutControlItem8.BeginInit();
            this.layoutControlItem9.BeginInit();
            this.layoutControlItem10.BeginInit();
            this.emptySpaceItem1.BeginInit();
            this.emptySpaceItem2.BeginInit();
            this.layoutControlItem20.BeginInit();
            this.layoutControlItem21.BeginInit();
            base.SuspendLayout();
            base.btnSave.Location = new Point(0xbd, 0x176);
            base.btnSave.TabIndex = 1;
            base.btnCancel.Location = new Point(0x185, 0x176);
            base.btnCancel.TabIndex = 3;
            base.btnSaveNew.Location = new Point(0x120, 0x176);
            base.btnSaveNew.TabIndex = 2;
            base.imageCollection2.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection2.ImageStream");
            this.groupControl1.Controls.Add(this.layoutControl1);
            this.groupControl1.Dock = DockStyle.Top;
            this.groupControl1.Location = new Point(0, 0);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new Size(0x1f2, 0x16d);
            this.groupControl1.TabIndex = 0;
            this.groupControl1.Text = "Đợt B\x00e1o C\x00e1o";
            this.layoutControl1.Controls.Add(this.txtDescription);
            this.layoutControl1.Controls.Add(this.rdIsBegin);
            this.layoutControl1.Controls.Add(this.groupBox1);
            this.layoutControl1.Controls.Add(this.calUnemploymentInsurance);
            this.layoutControl1.Controls.Add(this.calHealthInsurance);
            this.layoutControl1.Controls.Add(this.calSocialInsurance);
            this.layoutControl1.Controls.Add(this.calMaximumInsurance);
            this.layoutControl1.Controls.Add(this.calMinimumSalary);
            this.layoutControl1.Controls.Add(this.txtCourse);
            this.layoutControl1.Controls.Add(this.dtYear);
            this.layoutControl1.Controls.Add(this.dtMonth);
            this.layoutControl1.Controls.Add(this.txtName);
            this.layoutControl1.Dock = DockStyle.Fill;
            this.layoutControl1.Location = new Point(2, 0x16);
            this.layoutControl1.Name = "layoutControl1";
            this.layoutControl1.Root = this.layoutControlGroup1;
            this.layoutControl1.Size = new Size(0x1ee, 0x155);
            this.layoutControl1.TabIndex = 0;
            this.layoutControl1.Text = "layoutControl1";
            this.txtDescription.Location = new Point(0x5c, 0x12f);
            this.txtDescription.Name = "txtDescription";
            this.txtDescription.Size = new Size(390, 0x1a);
            this.txtDescription.StyleController = this.layoutControl1;
            this.txtDescription.TabIndex = 11;
            this.rdIsBegin.Location = new Point(12, 60);
            this.rdIsBegin.Name = "rdIsBegin";
            this.rdIsBegin.Properties.Appearance.BackColor = Color.Transparent;
            this.rdIsBegin.Properties.Appearance.Options.UseBackColor = true;
            this.rdIsBegin.Properties.BorderStyle = BorderStyles.NoBorder;
            this.rdIsBegin.Properties.Items.AddRange(new RadioGroupItem[] { new RadioGroupItem(null, "Đơn vị bắt đầu tham gia BHXH"), new RadioGroupItem(null, "Đơn vị đ\x00e3 v\x00e0 đang tham gia BHXH") });
            this.rdIsBegin.Size = new Size(470, 0x17);
            this.rdIsBegin.StyleController = this.layoutControl1;
            this.rdIsBegin.TabIndex = 4;
            this.groupBox1.Controls.Add(this.layoutControl2);
            this.groupBox1.Location = new Point(12, 0x61);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(470, 0x90);
            this.groupBox1.TabIndex = 5;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Nhập số lao động, quỹ lương kỳ trước";
            this.layoutControl2.Controls.Add(this.calSendUnemploymentInsurance);
            this.layoutControl2.Controls.Add(this.calWageUnemploymentInsurance);
            this.layoutControl2.Controls.Add(this.calSendHealthInsurance);
            this.layoutControl2.Controls.Add(this.calWageHealthInsurance);
            this.layoutControl2.Controls.Add(this.calSendSocialInsurance);
            this.layoutControl2.Controls.Add(this.calWageSocialInsurance);
            this.layoutControl2.Controls.Add(this.calQuantityUnemploymentInsurance);
            this.layoutControl2.Controls.Add(this.calQuantityHealthInsurance);
            this.layoutControl2.Controls.Add(this.calQuantitySocialInsurance);
            this.layoutControl2.Dock = DockStyle.Fill;
            this.layoutControl2.Location = new Point(3, 0x11);
            this.layoutControl2.Name = "layoutControl2";
            this.layoutControl2.Root = this.layoutControlGroup2;
            this.layoutControl2.Size = new Size(0x1d0, 0x7c);
            this.layoutControl2.TabIndex = 0;
            this.layoutControl2.Text = "layoutControl2";
            this.calSendUnemploymentInsurance.Location = new Point(0x141, 0x54);
            this.calSendUnemploymentInsurance.Name = "calSendUnemploymentInsurance";
            this.calSendUnemploymentInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calSendUnemploymentInsurance.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calSendUnemploymentInsurance.Size = new Size(0x83, 20);
            this.calSendUnemploymentInsurance.StyleController = this.layoutControl2;
            this.calSendUnemploymentInsurance.TabIndex = 8;
            this.calWageUnemploymentInsurance.Location = new Point(0x63, 0x54);
            this.calWageUnemploymentInsurance.Name = "calWageUnemploymentInsurance";
            this.calWageUnemploymentInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calWageUnemploymentInsurance.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calWageUnemploymentInsurance.Size = new Size(0x83, 20);
            this.calWageUnemploymentInsurance.StyleController = this.layoutControl2;
            this.calWageUnemploymentInsurance.TabIndex = 7;
            this.calSendHealthInsurance.Location = new Point(0x141, 60);
            this.calSendHealthInsurance.Name = "calSendHealthInsurance";
            this.calSendHealthInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calSendHealthInsurance.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calSendHealthInsurance.Size = new Size(0x83, 20);
            this.calSendHealthInsurance.StyleController = this.layoutControl2;
            this.calSendHealthInsurance.TabIndex = 6;
            this.calWageHealthInsurance.Location = new Point(0x63, 60);
            this.calWageHealthInsurance.Name = "calWageHealthInsurance";
            this.calWageHealthInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calWageHealthInsurance.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calWageHealthInsurance.Size = new Size(0x83, 20);
            this.calWageHealthInsurance.StyleController = this.layoutControl2;
            this.calWageHealthInsurance.TabIndex = 5;
            this.calSendSocialInsurance.Location = new Point(0x141, 0x24);
            this.calSendSocialInsurance.Name = "calSendSocialInsurance";
            this.calSendSocialInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calSendSocialInsurance.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calSendSocialInsurance.Size = new Size(0x83, 20);
            this.calSendSocialInsurance.StyleController = this.layoutControl2;
            this.calSendSocialInsurance.TabIndex = 4;
            this.calWageSocialInsurance.Location = new Point(0x63, 0x24);
            this.calWageSocialInsurance.Name = "calWageSocialInsurance";
            this.calWageSocialInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calWageSocialInsurance.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calWageSocialInsurance.Size = new Size(0x83, 20);
            this.calWageSocialInsurance.StyleController = this.layoutControl2;
            this.calWageSocialInsurance.TabIndex = 3;
            this.calQuantityUnemploymentInsurance.Location = new Point(0x174, 12);
            this.calQuantityUnemploymentInsurance.Name = "calQuantityUnemploymentInsurance";
            this.calQuantityUnemploymentInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calQuantityUnemploymentInsurance.Size = new Size(80, 20);
            this.calQuantityUnemploymentInsurance.StyleController = this.layoutControl2;
            this.calQuantityUnemploymentInsurance.TabIndex = 2;
            this.calQuantityHealthInsurance.Location = new Point(0xea, 12);
            this.calQuantityHealthInsurance.Name = "calQuantityHealthInsurance";
            this.calQuantityHealthInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calQuantityHealthInsurance.Size = new Size(0x4f, 20);
            this.calQuantityHealthInsurance.StyleController = this.layoutControl2;
            this.calQuantityHealthInsurance.TabIndex = 1;
            this.calQuantitySocialInsurance.Location = new Point(0x63, 12);
            this.calQuantitySocialInsurance.Name = "calQuantitySocialInsurance";
            this.calQuantitySocialInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calQuantitySocialInsurance.Size = new Size(0x4c, 20);
            this.calQuantitySocialInsurance.StyleController = this.layoutControl2;
            this.calQuantitySocialInsurance.TabIndex = 0;
            this.layoutControlGroup2.CustomizationFormText = "layoutControlGroup2";
            this.layoutControlGroup2.EnableIndentsWithoutBorders = DefaultBoolean.True;
            this.layoutControlGroup2.GroupBordersVisible = false;
            this.layoutControlGroup2.Items.AddRange(new BaseLayoutItem[] { this.layoutControlItem11, this.layoutControlItem12, this.layoutControlItem13, this.layoutControlItem14, this.layoutControlItem15, this.layoutControlItem16, this.layoutControlItem17, this.layoutControlItem18, this.layoutControlItem19 });
            this.layoutControlGroup2.Location = new Point(0, 0);
            this.layoutControlGroup2.Name = "layoutControlGroup2";
            this.layoutControlGroup2.Size = new Size(0x1d0, 0x7c);
            this.layoutControlGroup2.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlGroup2.Text = "layoutControlGroup2";
            this.layoutControlGroup2.TextVisible = false;
            this.layoutControlItem11.Control = this.calQuantitySocialInsurance;
            this.layoutControlItem11.CustomizationFormText = "Số LĐ BHXH:";
            this.layoutControlItem11.Location = new Point(0, 0);
            this.layoutControlItem11.Name = "layoutControlItem11";
            this.layoutControlItem11.Size = new Size(0xa7, 0x18);
            this.layoutControlItem11.Text = "Số LĐ BHXH:";
            this.layoutControlItem11.TextSize = new Size(0x53, 13);
            this.layoutControlItem12.Control = this.calQuantityHealthInsurance;
            this.layoutControlItem12.CustomizationFormText = "BHYT:";
            this.layoutControlItem12.Location = new Point(0xa7, 0);
            this.layoutControlItem12.Name = "layoutControlItem12";
            this.layoutControlItem12.Size = new Size(0x8a, 0x18);
            this.layoutControlItem12.Text = "BHYT:";
            this.layoutControlItem12.TextAlignMode = TextAlignModeItem.CustomSize;
            this.layoutControlItem12.TextSize = new Size(50, 20);
            this.layoutControlItem12.TextToControlDistance = 5;
            this.layoutControlItem13.Control = this.calQuantityUnemploymentInsurance;
            this.layoutControlItem13.CustomizationFormText = "BHTN:";
            this.layoutControlItem13.Location = new Point(0x131, 0);
            this.layoutControlItem13.Name = "layoutControlItem13";
            this.layoutControlItem13.Size = new Size(0x8b, 0x18);
            this.layoutControlItem13.Text = "BHTN:";
            this.layoutControlItem13.TextAlignMode = TextAlignModeItem.CustomSize;
            this.layoutControlItem13.TextSize = new Size(50, 20);
            this.layoutControlItem13.TextToControlDistance = 5;
            this.layoutControlItem14.Control = this.calWageSocialInsurance;
            this.layoutControlItem14.CustomizationFormText = "Quỹ lương BHXH:";
            this.layoutControlItem14.Location = new Point(0, 0x18);
            this.layoutControlItem14.Name = "layoutControlItem14";
            this.layoutControlItem14.Size = new Size(0xde, 0x18);
            this.layoutControlItem14.Text = "Quỹ lương BHXH:";
            this.layoutControlItem14.TextSize = new Size(0x53, 13);
            this.layoutControlItem15.Control = this.calSendSocialInsurance;
            this.layoutControlItem15.CustomizationFormText = "Nộp BHXH:";
            this.layoutControlItem15.Location = new Point(0xde, 0x18);
            this.layoutControlItem15.Name = "layoutControlItem15";
            this.layoutControlItem15.Size = new Size(0xde, 0x18);
            this.layoutControlItem15.Text = "Nộp BHXH:";
            this.layoutControlItem15.TextSize = new Size(0x53, 13);
            this.layoutControlItem16.Control = this.calWageHealthInsurance;
            this.layoutControlItem16.CustomizationFormText = "Quỹ lương BHYT:";
            this.layoutControlItem16.Location = new Point(0, 0x30);
            this.layoutControlItem16.Name = "layoutControlItem16";
            this.layoutControlItem16.Size = new Size(0xde, 0x18);
            this.layoutControlItem16.Text = "Quỹ lương BHYT:";
            this.layoutControlItem16.TextSize = new Size(0x53, 13);
            this.layoutControlItem17.Control = this.calSendHealthInsurance;
            this.layoutControlItem17.CustomizationFormText = "Nộp BHYT:";
            this.layoutControlItem17.Location = new Point(0xde, 0x30);
            this.layoutControlItem17.Name = "layoutControlItem17";
            this.layoutControlItem17.Size = new Size(0xde, 0x18);
            this.layoutControlItem17.Text = "Nộp BHYT:";
            this.layoutControlItem17.TextSize = new Size(0x53, 13);
            this.layoutControlItem18.Control = this.calWageUnemploymentInsurance;
            this.layoutControlItem18.CustomizationFormText = "Quỹ lương BHTN:";
            this.layoutControlItem18.Location = new Point(0, 0x48);
            this.layoutControlItem18.Name = "layoutControlItem18";
            this.layoutControlItem18.Size = new Size(0xde, 0x20);
            this.layoutControlItem18.Text = "Quỹ lương BHTN:";
            this.layoutControlItem18.TextSize = new Size(0x53, 13);
            this.layoutControlItem19.Control = this.calSendUnemploymentInsurance;
            this.layoutControlItem19.CustomizationFormText = "Nộp BHTN:";
            this.layoutControlItem19.Location = new Point(0xde, 0x48);
            this.layoutControlItem19.Name = "layoutControlItem19";
            this.layoutControlItem19.Size = new Size(0xde, 0x20);
            this.layoutControlItem19.Text = "Nộp BHTN:";
            this.layoutControlItem19.TextSize = new Size(0x53, 13);
            this.calUnemploymentInsurance.Location = new Point(400, 0x117);
            this.calUnemploymentInsurance.Name = "calUnemploymentInsurance";
            this.calUnemploymentInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calUnemploymentInsurance.Size = new Size(0x52, 20);
            this.calUnemploymentInsurance.StyleController = this.layoutControl1;
            this.calUnemploymentInsurance.TabIndex = 10;
            this.calHealthInsurance.Location = new Point(0xfb, 0x117);
            this.calHealthInsurance.Name = "calHealthInsurance";
            this.calHealthInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calHealthInsurance.Size = new Size(0x58, 20);
            this.calHealthInsurance.StyleController = this.layoutControl1;
            this.calHealthInsurance.TabIndex = 9;
            this.calSocialInsurance.Location = new Point(0x5c, 0x117);
            this.calSocialInsurance.Name = "calSocialInsurance";
            this.calSocialInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calSocialInsurance.Size = new Size(0x63, 20);
            this.calSocialInsurance.StyleController = this.layoutControl1;
            this.calSocialInsurance.TabIndex = 8;
            this.calMaximumInsurance.Location = new Point(0x114, 0xff);
            this.calMaximumInsurance.Name = "calMaximumInsurance";
            this.calMaximumInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calMaximumInsurance.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calMaximumInsurance.Size = new Size(0xce, 20);
            this.calMaximumInsurance.StyleController = this.layoutControl1;
            this.calMaximumInsurance.TabIndex = 7;
            this.calMinimumSalary.Location = new Point(0x5c, 0xff);
            this.calMinimumSalary.Name = "calMinimumSalary";
            this.calMinimumSalary.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calMinimumSalary.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calMinimumSalary.Size = new Size(0x63, 20);
            this.calMinimumSalary.StyleController = this.layoutControl1;
            this.calMinimumSalary.TabIndex = 6;
            int[] bits = new int[4];
            bits[0] = 1;
            this.txtCourse.EditValue = new decimal(bits);
            this.txtCourse.Location = new Point(0x199, 0x24);
            this.txtCourse.Name = "txtCourse";
            this.txtCourse.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.txtCourse.Size = new Size(0x49, 20);
            this.txtCourse.StyleController = this.layoutControl1;
            this.txtCourse.TabIndex = 3;
            this.txtCourse.EditValueChanging += new ChangingEventHandler(this.txtCourse_EditValueChanging);
            this.dtYear.EditValue = new DateTime(0x7dc, 4, 5, 0, 0, 0, 0);
            this.dtYear.Location = new Point(0xe0, 0x24);
            this.dtYear.Name = "dtYear";
            this.dtYear.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtYear.Properties.Mask.EditMask = "yyyy";
            this.dtYear.Size = new Size(0x60, 20);
            this.dtYear.StyleController = this.layoutControl1;
            this.dtYear.TabIndex = 2;
            this.dtYear.EditValueChanging += new ChangingEventHandler(this.dtYear_EditValueChanging);
            this.dtMonth.EditValue = new DateTime(0x7dc, 4, 5, 0, 0, 0, 0);
            this.dtMonth.Location = new Point(0x5c, 0x24);
            this.dtMonth.Name = "dtMonth";
            this.dtMonth.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtMonth.Properties.Mask.EditMask = "MM";
            this.dtMonth.Size = new Size(0x49, 20);
            this.dtMonth.StyleController = this.layoutControl1;
            this.dtMonth.TabIndex = 1;
            this.dtMonth.EditValueChanging += new ChangingEventHandler(this.dtMonth_EditValueChanging);
            this.txtName.Location = new Point(0x5c, 12);
            this.txtName.Name = "txtName";
            this.txtName.Properties.ReadOnly = true;
            this.txtName.Size = new Size(390, 20);
            this.txtName.StyleController = this.layoutControl1;
            this.txtName.TabIndex = 0;
            this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1";
            this.layoutControlGroup1.EnableIndentsWithoutBorders = DefaultBoolean.True;
            this.layoutControlGroup1.GroupBordersVisible = false;
            this.layoutControlGroup1.Items.AddRange(new BaseLayoutItem[] { this.layoutControlItem1, this.layoutControlItem2, this.layoutControlItem3, this.layoutControlItem4, this.layoutControlItem5, this.layoutControlItem6, this.layoutControlItem7, this.layoutControlItem8, this.layoutControlItem9, this.layoutControlItem10, this.emptySpaceItem1, this.emptySpaceItem2, this.layoutControlItem20, this.layoutControlItem21 });
            this.layoutControlGroup1.Location = new Point(0, 0);
            this.layoutControlGroup1.Name = "layoutControlGroup1";
            this.layoutControlGroup1.Size = new Size(0x1ee, 0x155);
            this.layoutControlGroup1.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlGroup1.Text = "layoutControlGroup1";
            this.layoutControlGroup1.TextVisible = false;
            this.layoutControlItem1.AllowHtmlStringInCaption = true;
            this.layoutControlItem1.Control = this.txtName;
            this.layoutControlItem1.CustomizationFormText = "T\x00ean đợt:";
            this.layoutControlItem1.Location = new Point(0, 0);
            this.layoutControlItem1.Name = "layoutControlItem1";
            this.layoutControlItem1.Size = new Size(0x1da, 0x18);
            this.layoutControlItem1.Text = "T\x00ean đợt <color=red>(*)</color>:";
            this.layoutControlItem1.TextSize = new Size(0x4c, 14);
            this.layoutControlItem2.AllowHtmlStringInCaption = true;
            this.layoutControlItem2.Control = this.dtMonth;
            this.layoutControlItem2.CustomizationFormText = "V\x00e0o th\x00e1ng:";
            this.layoutControlItem2.Location = new Point(0, 0x18);
            this.layoutControlItem2.Name = "layoutControlItem2";
            this.layoutControlItem2.Size = new Size(0x9d, 0x18);
            this.layoutControlItem2.Text = "V\x00e0o th\x00e1ng <color=red>(*)</color>:";
            this.layoutControlItem2.TextSize = new Size(0x4c, 14);
            this.layoutControlItem3.AllowHtmlStringInCaption = true;
            this.layoutControlItem3.Control = this.dtYear;
            this.layoutControlItem3.CustomizationFormText = "Năm:";
            this.layoutControlItem3.Location = new Point(0x9d, 0x18);
            this.layoutControlItem3.Name = "layoutControlItem3";
            this.layoutControlItem3.Size = new Size(0x9b, 0x18);
            this.layoutControlItem3.Text = "Năm <color=red>(*)</color>:";
            this.layoutControlItem3.TextAlignMode = TextAlignModeItem.CustomSize;
            this.layoutControlItem3.TextSize = new Size(50, 20);
            this.layoutControlItem3.TextToControlDistance = 5;
            this.layoutControlItem4.AllowHtmlStringInCaption = true;
            this.layoutControlItem4.Control = this.txtCourse;
            this.layoutControlItem4.CustomizationFormText = "Đợt b\x00e1o c\x00e1o:";
            this.layoutControlItem4.Location = new Point(0x138, 0x18);
            this.layoutControlItem4.Name = "layoutControlItem4";
            this.layoutControlItem4.Size = new Size(0xa2, 0x18);
            this.layoutControlItem4.Text = "Đợt b\x00e1o c\x00e1o <color=red>(*)</color>:";
            this.layoutControlItem4.TextAlignMode = TextAlignModeItem.AutoSize;
            this.layoutControlItem4.TextSize = new Size(80, 14);
            this.layoutControlItem4.TextToControlDistance = 5;
            this.layoutControlItem5.Control = this.calMinimumSalary;
            this.layoutControlItem5.CustomizationFormText = "Lương tối thiểu:";
            this.layoutControlItem5.Location = new Point(0, 0xf3);
            this.layoutControlItem5.Name = "layoutControlItem5";
            this.layoutControlItem5.Size = new Size(0xb7, 0x18);
            this.layoutControlItem5.Text = "Lương tối thiểu:";
            this.layoutControlItem5.TextSize = new Size(0x4c, 13);
            this.layoutControlItem6.Control = this.calMaximumInsurance;
            this.layoutControlItem6.CustomizationFormText = "Lương trần:";
            this.layoutControlItem6.Location = new Point(0xb7, 0xf3);
            this.layoutControlItem6.Name = "layoutControlItem6";
            this.layoutControlItem6.Size = new Size(0x123, 0x18);
            this.layoutControlItem6.Text = "Lương trần:";
            this.layoutControlItem6.TextAlignMode = TextAlignModeItem.CustomSize;
            this.layoutControlItem6.TextSize = new Size(0x4c, 13);
            this.layoutControlItem6.TextToControlDistance = 5;
            this.layoutControlItem7.Control = this.calSocialInsurance;
            this.layoutControlItem7.CustomizationFormText = "BHXH (%):";
            this.layoutControlItem7.Location = new Point(0, 0x10b);
            this.layoutControlItem7.Name = "layoutControlItem7";
            this.layoutControlItem7.Size = new Size(0xb7, 0x18);
            this.layoutControlItem7.Text = "BHXH (%):";
            this.layoutControlItem7.TextSize = new Size(0x4c, 13);
            this.layoutControlItem8.Control = this.calHealthInsurance;
            this.layoutControlItem8.CustomizationFormText = "BHYT (%):";
            this.layoutControlItem8.Location = new Point(0xb7, 0x10b);
            this.layoutControlItem8.Name = "layoutControlItem8";
            this.layoutControlItem8.Size = new Size(0x94, 0x18);
            this.layoutControlItem8.Text = "BHYT (%):";
            this.layoutControlItem8.TextAlignMode = TextAlignModeItem.AutoSize;
            this.layoutControlItem8.TextSize = new Size(0x33, 13);
            this.layoutControlItem8.TextToControlDistance = 5;
            this.layoutControlItem9.Control = this.calUnemploymentInsurance;
            this.layoutControlItem9.CustomizationFormText = "BHTN (%):";
            this.layoutControlItem9.Location = new Point(0x14b, 0x10b);
            this.layoutControlItem9.Name = "layoutControlItem9";
            this.layoutControlItem9.Size = new Size(0x8f, 0x18);
            this.layoutControlItem9.Text = "BHTN (%):";
            this.layoutControlItem9.TextAlignMode = TextAlignModeItem.AutoSize;
            this.layoutControlItem9.TextSize = new Size(0x34, 13);
            this.layoutControlItem9.TextToControlDistance = 5;
            this.layoutControlItem10.Control = this.groupBox1;
            this.layoutControlItem10.CustomizationFormText = "layoutControlItem10";
            this.layoutControlItem10.Location = new Point(0, 0x55);
            this.layoutControlItem10.Name = "layoutControlItem10";
            this.layoutControlItem10.Size = new Size(0x1da, 0x94);
            this.layoutControlItem10.Text = "layoutControlItem10";
            this.layoutControlItem10.TextSize = new Size(0, 0);
            this.layoutControlItem10.TextToControlDistance = 0;
            this.layoutControlItem10.TextVisible = false;
            this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1";
            this.emptySpaceItem1.Location = new Point(0, 0x4b);
            this.emptySpaceItem1.Name = "emptySpaceItem1";
            this.emptySpaceItem1.Size = new Size(0x1da, 10);
            this.emptySpaceItem1.Text = "emptySpaceItem1";
            this.emptySpaceItem1.TextSize = new Size(0, 0);
            this.emptySpaceItem2.CustomizationFormText = "emptySpaceItem2";
            this.emptySpaceItem2.Location = new Point(0, 0xe9);
            this.emptySpaceItem2.Name = "emptySpaceItem2";
            this.emptySpaceItem2.Size = new Size(0x1da, 10);
            this.emptySpaceItem2.Text = "emptySpaceItem2";
            this.emptySpaceItem2.TextSize = new Size(0, 0);
            this.layoutControlItem20.Control = this.rdIsBegin;
            this.layoutControlItem20.CustomizationFormText = "layoutControlItem20";
            this.layoutControlItem20.Location = new Point(0, 0x30);
            this.layoutControlItem20.Name = "layoutControlItem20";
            this.layoutControlItem20.Size = new Size(0x1da, 0x1b);
            this.layoutControlItem20.Text = "layoutControlItem20";
            this.layoutControlItem20.TextSize = new Size(0, 0);
            this.layoutControlItem20.TextToControlDistance = 0;
            this.layoutControlItem20.TextVisible = false;
            this.layoutControlItem21.Control = this.txtDescription;
            this.layoutControlItem21.CustomizationFormText = "Ghi ch\x00fa kh\x00e1c:";
            this.layoutControlItem21.Location = new Point(0, 0x123);
            this.layoutControlItem21.Name = "layoutControlItem21";
            this.layoutControlItem21.Size = new Size(0x1da, 30);
            this.layoutControlItem21.Text = "Ghi ch\x00fa kh\x00e1c:";
            this.layoutControlItem21.TextSize = new Size(0x4c, 13);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.groupControl1);
            base.Name = "xucInsuranceAdd";
            base.Size = new Size(0x1f2, 410);
            base.Controls.SetChildIndex(base.btnCancel, 0);
            base.Controls.SetChildIndex(base.btnSave, 0);
            base.Controls.SetChildIndex(base.btnSaveNew, 0);
            base.Controls.SetChildIndex(this.groupControl1, 0);
            ((ISupportInitialize) base.Err).EndInit();
            base.imageCollection2.EndInit();
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.layoutControl1.EndInit();
            this.layoutControl1.ResumeLayout(false);
            this.txtDescription.Properties.EndInit();
            this.rdIsBegin.Properties.EndInit();
            this.groupBox1.ResumeLayout(false);
            this.layoutControl2.EndInit();
            this.layoutControl2.ResumeLayout(false);
            this.calSendUnemploymentInsurance.Properties.EndInit();
            this.calWageUnemploymentInsurance.Properties.EndInit();
            this.calSendHealthInsurance.Properties.EndInit();
            this.calWageHealthInsurance.Properties.EndInit();
            this.calSendSocialInsurance.Properties.EndInit();
            this.calWageSocialInsurance.Properties.EndInit();
            this.calQuantityUnemploymentInsurance.Properties.EndInit();
            this.calQuantityHealthInsurance.Properties.EndInit();
            this.calQuantitySocialInsurance.Properties.EndInit();
            this.layoutControlGroup2.EndInit();
            this.layoutControlItem11.EndInit();
            this.layoutControlItem12.EndInit();
            this.layoutControlItem13.EndInit();
            this.layoutControlItem14.EndInit();
            this.layoutControlItem15.EndInit();
            this.layoutControlItem16.EndInit();
            this.layoutControlItem17.EndInit();
            this.layoutControlItem18.EndInit();
            this.layoutControlItem19.EndInit();
            this.calUnemploymentInsurance.Properties.EndInit();
            this.calHealthInsurance.Properties.EndInit();
            this.calSocialInsurance.Properties.EndInit();
            this.calMaximumInsurance.Properties.EndInit();
            this.calMinimumSalary.Properties.EndInit();
            this.txtCourse.Properties.EndInit();
            this.dtYear.Properties.EndInit();
            this.dtMonth.Properties.EndInit();
            this.txtName.Properties.EndInit();
            this.layoutControlGroup1.EndInit();
            this.layoutControlItem1.EndInit();
            this.layoutControlItem2.EndInit();
            this.layoutControlItem3.EndInit();
            this.layoutControlItem4.EndInit();
            this.layoutControlItem5.EndInit();
            this.layoutControlItem6.EndInit();
            this.layoutControlItem7.EndInit();
            this.layoutControlItem8.EndInit();
            this.layoutControlItem9.EndInit();
            this.layoutControlItem10.EndInit();
            this.emptySpaceItem1.EndInit();
            this.emptySpaceItem2.EndInit();
            this.layoutControlItem20.EndInit();
            this.layoutControlItem21.EndInit();
            base.ResumeLayout(false);
        }

        private void RaiseSuccessEventHander(HRM_INSURANCE_TABLELIST item)
        {
            if (this.Success != null)
            {
                this.Success(this, item);
            }
        }

        public void SetData(HRM_INSURANCE_TABLELIST item)
        {
            this.m_InsuranceTableListID = item.InsuranceTableListID;
            SYS_LOG.Insert("Đợt B\x00e1o C\x00e1o", "Xem", this.m_InsuranceTableListID.ToString());
            this.txtName.Text = item.InsuranceTableListName;
            this.dtMonth.EditValue = new DateTime(item.Year, item.Month, 1);
            this.dtYear.EditValue = new DateTime(item.Year, item.Month, 1);
            this.txtCourse.Text = item.Course.ToString();
            this.calSocialInsurance.EditValue = item.SocialInsurance * 100.0;
            this.calHealthInsurance.EditValue = item.HealthInsurance * 100.0;
            this.calUnemploymentInsurance.EditValue = item.UnemploymentInsurance * 100.0;
            this.calMaximumInsurance.EditValue = item.MaximumInsurance;
            this.calMinimumSalary.EditValue = item.MinimumSalary;
            this.calWageSocialInsurance.EditValue = item.WageSocialInsurance;
            this.calWageHealthInsurance.EditValue = item.WageHealthInsurance;
            this.calWageUnemploymentInsurance.EditValue = item.WageUnemploymentInsurance;
            this.calSendSocialInsurance.EditValue = item.SendSocialInsurance;
            this.calSendHealthInsurance.EditValue = item.SendHealthInsurance;
            this.calSendUnemploymentInsurance.EditValue = item.SendUnemploymentInsurance;
            this.calQuantitySocialInsurance.EditValue = item.QuantitySocialInsurance;
            this.calQuantityHealthInsurance.EditValue = item.QuantityHealthInsurance;
            this.calQuantityUnemploymentInsurance.EditValue = item.QuantityUnemploymentInsurance;
            this.txtDescription.Text = item.Description;
            if (item.IsBegin)
            {
                this.rdIsBegin.SelectedIndex = 0;
            }
            else
            {
                this.rdIsBegin.SelectedIndex = 1;
            }
        }

        private void txtCourse_EditValueChanging(object sender, ChangingEventArgs e)
        {
            this.txtName.Text = "Đợt " + e.NewValue.ToString() + " (Th\x00e1ng " + DateTime.Parse(this.dtMonth.EditValue.ToString()).Month.ToString() + "/" + DateTime.Parse(this.dtYear.EditValue.ToString()).Year.ToString() + ")";
        }

        protected override string uc_Change()
        {
            return string.Empty;
        }

        protected override string uc_Delete()
        {
            HRM_INSURANCE_TABLELIST item = new HRM_INSURANCE_TABLELIST {
                InsuranceTableListID = this.m_InsuranceTableListID
            };
            string str = item.Delete();
            if (str == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            return str;
        }

        protected override string uc_Save()
        {
            if (MyRule.Get(MyLogin.RoleId, "bbiInsurance") != "OK")
            {
                return "";
            }
            if (!MyRule.AllowAdd)
            {
                MyRule.Notify();
                return "";
            }
            SYS_LOG.Insert("Đợt B\x00e1o C\x00e1o", "Th\x00eam", this.m_InsuranceTableListID.ToString());
            base.SetWaitDialogCaption("Đang lưu dữ liệu...");
            Cursor.Current = Cursors.WaitCursor;
            HRM_INSURANCE_TABLELIST item = new HRM_INSURANCE_TABLELIST {
                InsuranceTableListID = Guid.NewGuid(),
                InsuranceTableListName = this.txtName.Text,
                Month = Convert.ToInt32(this.dtMonth.Text),
                Year = Convert.ToInt32(this.dtYear.Text),
                Course = Convert.ToInt32(this.txtCourse.Text)
            };
            if (this.rdIsBegin.SelectedIndex == 0)
            {
                item.IsBegin = true;
            }
            else
            {
                item.IsBegin = false;
            }
            item.SocialInsurance = Convert.ToDouble(this.calSocialInsurance.EditValue.ToString()) / 100.0;
            item.HealthInsurance = Convert.ToDouble(this.calHealthInsurance.EditValue.ToString()) / 100.0;
            item.UnemploymentInsurance = Convert.ToDouble(this.calUnemploymentInsurance.EditValue.ToString()) / 100.0;
            item.QuantitySocialInsurance = Convert.ToInt32(this.calQuantitySocialInsurance.EditValue.ToString());
            item.QuantityHealthInsurance = Convert.ToInt32(this.calQuantityHealthInsurance.EditValue.ToString());
            item.QuantityUnemploymentInsurance = Convert.ToInt32(this.calQuantityUnemploymentInsurance.EditValue.ToString());
            item.WageSocialInsurance = Convert.ToDecimal(this.calWageSocialInsurance.EditValue.ToString());
            item.WageHealthInsurance = Convert.ToDecimal(this.calWageHealthInsurance.EditValue.ToString());
            item.WageUnemploymentInsurance = Convert.ToDecimal(this.calWageUnemploymentInsurance.EditValue.ToString());
            item.SendSocialInsurance = Convert.ToDecimal(this.calSendSocialInsurance.EditValue.ToString());
            item.SendHealthInsurance = Convert.ToDecimal(this.calSendHealthInsurance.EditValue.ToString());
            item.SendUnemploymentInsurance = Convert.ToDecimal(this.calSendUnemploymentInsurance.EditValue.ToString());
            item.MaximumInsurance = Convert.ToDecimal(this.calMaximumInsurance.EditValue.ToString());
            item.MinimumSalary = Convert.ToDecimal(this.calMinimumSalary.EditValue.ToString());
            item.Description = this.txtDescription.Text;
            string text = item.Insert();
            if (text == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            Cursor.Current = Cursors.Default;
            this.DoHide();
            if (text != "OK")
            {
                XtraMessageBox.Show(text, "Cảnh B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            return text;
        }

        protected override string uc_Update()
        {
            if (MyRule.Get(MyLogin.RoleId, "bbiInsurance") != "OK")
            {
                return "";
            }
            if (!MyRule.AllowEdit)
            {
                MyRule.Notify();
                return "";
            }
            SYS_LOG.Insert("Đợt B\x00e1o C\x00e1o", "Cập Nhật", this.m_InsuranceTableListID.ToString());
            base.SetWaitDialogCaption("Đang cập nhật dữ liệu...");
            HRM_INSURANCE_TABLELIST item = new HRM_INSURANCE_TABLELIST {
                InsuranceTableListID = this.m_InsuranceTableListID,
                InsuranceTableListName = this.txtName.Text,
                Month = Convert.ToInt32(this.dtMonth.Text),
                Year = Convert.ToInt32(this.dtYear.Text),
                Course = Convert.ToInt32(this.txtCourse.Text)
            };
            if (this.rdIsBegin.SelectedIndex == 0)
            {
                item.IsBegin = true;
            }
            else
            {
                item.IsBegin = false;
            }
            item.SocialInsurance = Convert.ToDouble(this.calSocialInsurance.EditValue.ToString()) / 100.0;
            item.HealthInsurance = Convert.ToDouble(this.calHealthInsurance.EditValue.ToString()) / 100.0;
            item.UnemploymentInsurance = Convert.ToDouble(this.calUnemploymentInsurance.EditValue.ToString()) / 100.0;
            item.QuantitySocialInsurance = Convert.ToInt32(this.calQuantitySocialInsurance.EditValue.ToString());
            item.QuantityHealthInsurance = Convert.ToInt32(this.calQuantityHealthInsurance.EditValue.ToString());
            item.QuantityUnemploymentInsurance = Convert.ToInt32(this.calQuantityUnemploymentInsurance.EditValue.ToString());
            item.WageSocialInsurance = Convert.ToDecimal(this.calWageSocialInsurance.EditValue.ToString());
            item.WageHealthInsurance = Convert.ToDecimal(this.calWageHealthInsurance.EditValue.ToString());
            item.WageUnemploymentInsurance = Convert.ToDecimal(this.calWageUnemploymentInsurance.EditValue.ToString());
            item.SendSocialInsurance = Convert.ToDecimal(this.calSendSocialInsurance.EditValue.ToString());
            item.SendHealthInsurance = Convert.ToDecimal(this.calSendHealthInsurance.EditValue.ToString());
            item.SendUnemploymentInsurance = Convert.ToDecimal(this.calSendUnemploymentInsurance.EditValue.ToString());
            item.MaximumInsurance = Convert.ToDecimal(this.calMaximumInsurance.EditValue.ToString());
            item.MinimumSalary = Convert.ToDecimal(this.calMinimumSalary.EditValue.ToString());
            item.Description = this.txtDescription.Text;
            string text = item.Update();
            if (text == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            if (text != "OK")
            {
                XtraMessageBox.Show(text, "Cảnh B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            this.DoHide();
            return text;
        }

        public delegate void SuccessEventHander(object sender, HRM_INSURANCE_TABLELIST item);
    }
}

